from openai import OpenAI
client = OpenAI(
    api_key="sk-XelpeD1K6Q5o9GjxfppXLF2alR8aZeThffX4W6gTqJslYIDy",
    base_url="https://api.chatanywhere.tech/v1"
)

def do_sort(nums):
    arr = nums
    prompt = ''
    for i in range(len(arr)):
        prompt = arr[i]

    return prompt


def get_completion(prompt, model= "gpt-3.5-turbo"):
    newPrompt = do_sort(prompt)
    message = [
        {
            "role": "user",
            "content": newPrompt
        }
    ]
    response = client.chat.completions.create(
        model= model,
        messages=message
    )



    return response.choices[0].message

if __name__ == '__main__':
    mes = get_completion(['给我一个navicat16的下载地址'])
    print(mes)